package cn.com.utt.common.message;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;

public class ResetResp extends Message {
	@JSONField(name = "status")
	private int status;
	@JSONField(name = "error")
	private Fault error;

	public ResetResp() {
		setType(MessageType.RESETRESP.toString());
	}

	@Override
	public String encode() {
		return JSON.toJSONString(this);
	}

	@Override
	public void decode(byte[] buf) {
		ResetResp resetResp = JSON.parseObject(buf, ResetResp.class);
		this.setId(resetResp.getId());
		this.status = resetResp.getStatus();
		this.error = resetResp.getError();
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Fault getError() {
		return error;
	}

	public void setError(Fault error) {
		this.error = error;
	}

}
